<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />

<script src="https://static.robotwebtools.org/threejs/current/three.js"></script>
<script src="https://static.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>
<script src="https://static.robotwebtools.org/roslibjs/current/roslib.js"></script>
<script src="../build/ros3d.js"></script>

<script>
  /**
   * Setup all visualization elements when the page is loaded. 
   */
  function init() {
    // Connect to ROS.
    var ros = new ROSLIB.Ros({
      url : 'ws://localhost:9090'
    });

    // Create the main viewer.
    var viewer = new ROS3D.Viewer({
      divID : 'map',
      width : 800,
      height : 600,
      antialias : true
    });

    var mapClient = new ROS3D.OccupancyMapClient({
      ros: ros,
      rootObject: viewer.scene,
      continuous: false,
    });
  
  }
</script>
</head>

<body onload="init()">
  <h1>Simple Octomap Example</h1>

  <p>
    To run this example you'll require <a href="https://github.com/psaripp/octomap_server">octomap_server</a> ROS node.
    Run the following commands in the terminal from your ros workspace, then refresh this page. 
  </p>
  
  <ol>
    <li><tt>roscore</tt></li>
    <li><tt>rosrun octomap_server map_server ./src/octomap_server/tests/teapot.32.bt</tt></li>
    <li><tt>roslaunch rosbridge_server rosbridge_websocket.launch</tt></li>
  </ol>
  
  <div id="map"></div>
</body>
</html>
